import antfu from '@antfu/eslint-config'

export default antfu(
  {
    vue: true,
    typescript: true,
  },
  {
    // Remember to specify the file glob here, otherwise it might cause the vue plugin to handle non-vue files
    files: ['**/*.vue'],
    rules: {
      'vue/block-order': [2, {
        order: [['script', 'template'], 'style'],
      }], // 强制组件顶级元素的顺序
      'vue/html-self-closing': [0, {
        html: {
          void: 'never',
          normal: 'always',
          component: 'never',
        },
      }], // 强制自结束样式
      'vue/singleline-html-element-content-newline': 0, // 要求在单行元素的内容前后换行
      'vue/prop-name-casing': 0,
    },
  },
  {
    rules: {
      'ts/consistent-type-definitions': 0,
    },
  },
)
